const mysql = require('mysql2');
const pool = mysql.createPool({
  host: 'localhost',
  user: 'root',
  password: 'mysql_password',
  database: 'orm',
  namedPlaceholders: true,
  connectionLimit: 10,      //连接池的链接限制数量
  waitForConnections: true,   //是否等待连接
  queueLimit: 10,           //等待数量，
});
pool.query(`select * from tags where id=?`,[1],(err,result,fields)=>{
  if(err){
    console.error('error connecting'+err.stack);
    return;
  }
  console.log(result,fields);
})
